import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect:"/recommend"
  },
  {
    path: '/rank',
    name: 'rank',
    component:()=>import("@/components/rank/rank"),
    children:[
      {
        path:":id",
        component:()=>import("@/components/topList/top-list")
      }
    ]
  },
  {
    path: '/search',
    name: 'search',
    component:()=>import("@/components/search/search")
  },
  {
    path: '/singer',
    name: 'singer',
    component:()=>import("@/components/singer/singer"),
    children:[
      {
        path:":id",
        name:"singerDetail",
        component:()=>import("@/components/singerDetail/singerDetail")
      }
    ]
  },
  {
    path: '/recommend',
    name: 'recommend',
    component:()=>import("@/components/recommend/recommend"),
    children:[
      {
        path:":id",
        component:()=>import("@/components/disc/disc")
      }
    ]
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
